package com.hddx.controller;

import com.hddx.domain.Book;
import com.hddx.service.BookService;
import com.hddx.service.BookServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class BookController {
     @Autowired
     private BookServiceImpl bookService;
     @RequestMapping("queryBook")
    public ModelAndView queryBook(int id) {
         ModelAndView  modelAndview = new  ModelAndView ();
         Book book = bookService.queryBookById(id);
         modelAndview.addObject( "msg",book);
        modelAndview.setViewName( "success");
        return modelAndview;


    }
}
